import { TineConfigure, omitIndex } from '@tencent/rollup-config-tine';
export default {
    libType: 'pattern',
    entry: {
        filename: '[dir]',
        pattern: './src/**/index.ts'
    },
    output: {
        exports: 'named',
        dir: 'dist',
        format: 'esm',
        entryFileNames: omitIndex('[name]/index.js'),
        chunkFileNames: 'common/[name].js',
        globals: {
            react: 'react',
            'react-dom': 'reactDom',
            'react/jsx-runtime': 'reactJsxRuntime',
            'react/jsx-dev-runtime': 'reactJsxDevRuntime'
        }
    },
    external: [/^react/, /^react-dom/, /^@material/, /^@babel/, /^@tarojs\/\w+$/],
    build: {
        babelType: 'react-lib',
        target: process.env.NODE_ENV === 'production' ? 'es5' : 'es6',
        isMinify: process.env.NODE_ENV === 'production' ? true : false
    },
    declaration: {
        declarationDir: '',
        output: {
            dir: './dist',
            entryFileNames: omitIndex('[name]/index.d.ts'),
            chunkFileNames: 'common/[name].ts'
        }
    }
} satisfies TineConfigure;
